<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        /* 面向对象思想 */
        /* 表现力的JSON 对象字面量 */
        /* 对象自变量 */
        // let变量 关键字
        // key vau1e 格式
        // typeof   object  
        let zzp = {
            name: '杨探花',     //字符串   string
            hometown:'上饶鄱阳',
            age: 18,           //number  不适合计算   数值类型
            sex: '男',
            hobbies:['学习','乒乓球','探花'],  //对象 
            isSingle: false,
            job: null,
            sendFlower: function(target){
                target.receiveFlower(zzp);
            }
        }
        let a;
        let xm = {
            xq: 30,
            name: '小美',
            hometown: '赣州',
            receiveFlower: function(sender){
                console.log('小美收到了'+sender.name+'花');
                if(this.xq < 80){
                    console.log('不约，我们不合适');
                }else{
                    console.log('我们去硕果吧！');
                }

            }
        }
        let xh = {
            name : '小红',
            hometown: '上饶',
            receiveFlower: function(sender){
                /* js定时器 */
                setTimeout(function(){
                    xm.xq=90;
                    xm.receiveFlower(sender);
                },3000)
                /* console.log('小红收到了'+sender.name+'花');
                xm.receiveFlower(sender); */
                /* if (sender.name==='杨探花'){
                    console.log('让我们在一起吧...')
                } */
            }

        }
    </script>
</body>
</html>